package com.woniu.his.dao;

import com.woniu.his.entity.OperationDetailInfo;
import com.woniu.his.entity.OperationInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author TATO
 * @since 2019-11-25
 */
public interface OperationInfoMapper extends BaseMapper<OperationInfo> {

    OperationDetailInfo getOperationInfoByOperationId(int operationId);

    List<OperationDetailInfo> getOperationInfoByMedicalId(Integer medicalId);

    List<OperationDetailInfo> getOperationInfoList();

    int deleteOperationInfoByOperationId(int operationId);

    int updateOperationPayByOperationId(int operationId,int isPay);

    int updateOperationActionByOperationId(int operationId,int isAction);

    int updateOperationHandleByOperationId(int operationId,int isHandle);
    int updateOperationInfoByOperationId(int operationId, String operationType, String operationName, int docterId, Date operationTime);

    @Select("select count(*) from operation_info where is_action = 1")
    Integer getOperationInfoCount();

    @Select("select count(*) from operation_info where is_action =0")
    Integer getOperationInfoUnActionCount();

    List<OperationDetailInfo> getOperationInfoByAction();


}
